package com.simon.mengkou.future.handler;

import android.content.Context;

import com.ouertech.android.agm.lib.base.future.http.HttpEvent;
import com.ouertech.android.agm.lib.base.utils.UtilList;
import com.simon.mengkou.data.bean.base.Address;
import com.simon.mengkou.data.cache.DataCache;
import com.simon.mengkou.data.cache.DataCacheImpl;
import com.simon.mengkou.future.base.OuerHttpHandler;
import com.simon.mengkou.system.global.OuerApplication;
import com.simon.mengkou.system.global.OuerDispatcher;

import java.util.List;

/**
 * Created by xiazhenshui on 16/7/27.
 */
public class CartProductNumHandler extends OuerHttpHandler {

    public CartProductNumHandler(Context context) {
        super(context);
    }

    @Override
    public void onHandle(HttpEvent evt) throws Exception {
        Integer num = (Integer) evt.getData();
        OuerApplication.mPreferences.setCartProductNum(num);
        OuerDispatcher.sendAddCartBroadcast(mContext, num);
        evt.getFuture().commitComplete(num);
    }
}
